import request from '@/utils/request'

// 销售简报
export function crmIndexIndex(data) {
  return request({
    url: 'crm/index/index',
    method: 'post',
    data: data
  })
}

// 业绩指标
export function crmIndexAchievementData(data) {
  return request({
    url: 'crm/index/achievementData',
    method: 'post',
    data: data
  })
}

// 销售漏斗
export function crmIndexFunnel(data) {
  return request({
    url: 'crm/index/funnel',
    method: 'post',
    data: data
  })
}

// 销售趋势
export function crmIndexSaletrend(data) {
  return request({
    url: 'crm/index/saletrend',
    method: 'post',
    data: data
  })
}

// 工单库列表
export function crmWorkIndex(data) {
  return request({
    url: 'crm/wo/index',
    method: 'post',
    data: data
  })
}

// 完结库列表
export function crmCompleteIndex(data) {
  return request({
    url: 'crm/complete/index',
    method: 'post',
    data: data
  })
}

// 记账板块列表
export function crmAccountingIndex(data) {
    return request({
      url: 'crm/accounting/index',
      method: 'post',
      data: data
    })
  }
  // 外勤板块列表
export function crmPersonnelIndex(data) {
    return request({
      url: 'crm/personnel/index',
      method: 'post',
      data: data
    })
  }

    // 财务板块列表
export function crmFinanceIndex(data) {
    return request({
      url: 'crm/finance/index',
      method: 'post',
      data: data
    })
  }
      // 导出
// export function crmFinanceExport(data) {
//     return request({
//       url: 'crm/finance/export',
//       method: 'get',
//       params: data
//     })
//   }

export function crmFinanceExport(data) {
    return request({
      url: 'crm/finance/export',
      method: 'post',
      data: data,
      responseType: 'blob',
      timeout: 600000
    })
}

// 修改核算月份
export function updateCalculateMonth(data) {
  return request({
    url: 'crm/finance/updateCalculateMonth',
    method: 'post',
    data: data,
  })
}